<template>
  <van-nav-bar title="账号管理" left-arrow @click-left="$router.back()">
    <template #right>
      <van-icon name="ellipsis" size="18" />
    </template>
  </van-nav-bar>
  <div class="user_info">
    <div>
      <span>昵称</span>
      <input type="text" v-model="userdata.nickName" />
    </div>
    <div>
      <span>个性签名</span>
      <input type="text" v-model="userdata.introduceSign" />
    </div>
    <div>
      <span>修改密码</span>
      <input type="text" v-model="userdata.password" />
    </div>
  </div>
  <van-button type="info">保存</van-button>
  <van-button type="info">退出登录</van-button>
  <van-button type="info">信息按钮</van-button>
  <div>故事</div>
</template>
<script setup>
import { getuser } from "@/api/index.js";
import { onMounted, reactive } from "vue";
let userdata = reactive({
  nickName: "", //昵称
  loginName: "", //登录名
  introduceSign: "", //个性签名
  password: "",
});
onMounted(() => {
  getuserdata();
  console.log(1);
});
let getuserdata = () => {
  getuser().then((res) => {
    console.log(res);

    if (res.resultCode == 200) {
      userdata.nickName = res.data.nickName;
      userdata.loginName = res.data.loginName;
      userdata.introduceSign = res.data.introduceSign;
    }
  });
};
</script>
<style lang="less" scoped>
.user_info {
  color: #323233;
  font-size: 0.37333rem;
}
</style>
